#ifndef SOUNDPROVIDER_H
#define SOUNDPROVIDER_H

#include <QWidget>
#include <QMediaPlayer>
#include <QMediaPlaylist>

class Soundprovider : public QWidget
{
    Q_OBJECT
public:
    /**
     * Used to initialize Soundprovider.
     *
     * Call blocks until initialization sound has been played.
     */
    Soundprovider();
    ~Soundprovider();

    /**
     * play one random swing sound.
     * Index 0 is always excluded.
     */
    void playRandomSwing();

private:
    QMediaPlayer *player;
    QMediaPlaylist *playlist;

public slots:
    void play();
    void stop();
    void setVolume(int volume);
};

#endif // SOUNDPROVIDER_H
